﻿<phone:PhoneApplicationPage 
    x:Class="Social_Photos.MainPage"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">
    
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar>
            <shell:ApplicationBarIconButton x:Name="btnCapture" IconUri="/icons/appbar.feature.camera.rest.png" Text="Capture" Click="btnCapture_Click"/>
            <shell:ApplicationBarIconButton x:Name="btnRefresh" IconUri="/icons/appbar.refresh.rest.png" Text="Refresh" Click="btnRefresh_Click"/>
            <shell:ApplicationBarIconButton x:Name="btnChooseImage" IconUri="/icons/appbar.upload.rest.png" Text="choose" Click="btnChooseImage_Click"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">  
        <!--TitlePanel contains the name of the application and page title-->
        <!--<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,12">
            <TextBlock x:Name="ApplicationTitle" Text="SOCIAL PHOTOS" 
                       Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="Photos" Margin="9,-7,0,0" 
                       Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>-->

        <!--Use the recommended progress bar.-->
        <toolkit:PerformanceProgressBar Height="10" HorizontalAlignment="Left" Margin="10,0,10,0" 
                                        Name="requestProgress" VerticalAlignment="Top" 
                                        Width="455" Grid.Row="1" Visibility="Collapsed"
                                         IsIndeterminate="false" IsHitTestVisible="False"/>
        <!--Pivot Control-->
   
        <controls:Pivot>
            <!--Pivot item one-->
            <controls:PivotItem Header="Top Rated">
                <ListBox Margin="0,0,-12,0" Name="TopRated"  
            SelectionChanged="OnSelectionTopPhotos" Height="Auto">
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <toolkit:WrapPanel ItemHeight="120" ItemWidth="140"/>
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,0,15,0" Orientation="Vertical" 
                    HorizontalAlignment="Center">
                                <Image Source="{Binding image}"/>
                                 </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>             
            </controls:PivotItem>

            <!--Pivot item two-->
            <controls:PivotItem Header="My Photos">
                <ListBox Margin="0,0,-12,0" Name="MyPhoto"  
            SelectionChanged="OnSelectionMyPhotos" Height="Auto">
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <toolkit:WrapPanel ItemHeight="120" ItemWidth="140"/>
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Margin="0,0,15,0" Orientation="Vertical" 
                    HorizontalAlignment="Center">
                                <Image Source="{Binding image}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PivotItem>
        </controls:Pivot>
        <!--ContentPanel - place additional content here-->
        
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>